package com.leoman.spinningmachine.tab1;

import android.content.Context;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.leoman.helper.adapter.BaseRecyclerAdapter;
import com.leoman.helper.util.FrescoUtil;
import com.leoman.spinningmachine.R;
import com.leoman.spinningmachine.bean.QyNoticeBean;
import com.leoman.spinningmachine.util.DateUtil;

import java.util.List;

/**
 * Created by Administrator on 2018-06-05.
 */
public class QytzAdapter extends BaseRecyclerAdapter<QyNoticeBean>{

    private Context mContext;
    public QytzAdapter(Context context,int layoutResId, List data) {
        super(layoutResId, data);
        this.mContext = context;
    }

    @Override
    protected void bindTheData(BaseViewHolder holder, QyNoticeBean bean, int position) {
        TextView tv_head = (TextView) holder.findViewById(R.id.tv_head);
        SimpleDraweeView iv_pic = (SimpleDraweeView)holder.findViewById(R.id.iv_pic);
        TextView tv_qy_title = (TextView) holder.findViewById(R.id.tv_qy_title);

        TextView tv_msg_title = (TextView) holder.findViewById(R.id.tv_msg_title);
        TextView tv_msg_time = (TextView) holder.findViewById(R.id.tv_msg_time);

        String time  = DateUtil.getyMdHms(bean.getCreateDate(),"MM月dd日 HH:mm");
        tv_head.setText(""+ time);
        tv_qy_title.setText("企业通知");
        tv_msg_title.setText(""+bean.getTitle());
        tv_msg_time.setText(""+time);
        FrescoUtil.setImg(mContext,iv_pic,bean.getLogo());

    }

}
